import React, { Component } from 'react';

import NetUitl from '../../utils/HttpUtil';
import TitleBar from '../../components/TitleBar';
import WeeklyDevIndexes from '../../components/WeeklyDevIndexes';
import VHChart from '../../components/VHChart';
import AddTeam from "../../components/AddTeam";
import AddSaturation from "../../components/AddSaturation";
import AddTask from "../../components/AddTask";

class TeamBranchT extends Component {
    constructor(props) {
        super(props);
        this.state={
            id:1,

        }

    }
    
    render() {
        const {id,data,date} = this.props;
        let obj = {dimension:[],measure:[]};
        return (
                 <div className="page2">
                            <div style={{marginBottom:"8px",backgroundColor:"#fff"}}>
                                <AddTeam isAdd={false} id={3} date={date}  allData={data}></AddTeam>
                            </div>
                            <div style={{marginBottom:"8px",backgroundColor:"#fff"}}>
                                <AddSaturation id={3} date={date}   isAdd={false} allData={data}></AddSaturation>
                            </div>
                            <div className="flex-center-start-t"> 
                                <div className="team-left">
                                <AddTask isAdd={false} id={3} date={date} allData={data}></AddTask>
                                    
                                </div>
                                <div className="team-right">
                                    <TitleBar name="研发指标一周变化"/>
                                    <div className="tubiao-branch">
                                    <div style={{height:'200px',width:'100%'}}>
                                                <VHChart 
                                                    title={'新增及修改代码人均数'}
                                                    color={['#1890ff']}
                                                    chartType={'column'}
                                                    data={data && data.codeAvgChart ? data.codeAvgChart : obj}
                                                    markLineAvgUnit={'行'}
                                                    showMarkLine={true}
                                                    barWidth={25}
                                                />
                                            </div>
                                        <div style={{height:'200px',width:"100%"}}>
                                            <VHChart 
                                                title={'修改需求及BUG人均数'}
                                                color={['#C97EC1']}
                                                chartType={'column'}
                                                data={data && data.updateBugAndDemandAvgChart ? data.updateBugAndDemandAvgChart : obj}
                                                barWidth={30}
                                                markLineAvgUnit={'个'}
                                                showMarkLine={true}
                                            />
                                        </div>
                                        <div style={{height:'200px',width:"100%"}}>
                                            <VHChart 
                                                title={'出勤比率一周变化'}
                                                color={['#1890ff']}
                                                chartType={'column'}
                                                data={data && data.attendancePercentChart ? data.attendancePercentChart : obj}
                                                yAxisLabelFormatter={'%'}
                                                barWidth={30}
                                                searchDate={date}
                                                showMarkLine={false}
                                            />
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </div>
        );
    }
}

export default TeamBranchT;
